package com.meetingshow.privilege.service;

import java.util.ArrayList;
import java.util.List;

import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseServiceImp;
import com.meetingshow.common.base.service.model.QueryResults;
import com.meetingshow.privilege.dao.PriUserFollowDAO;
import com.meetingshow.privilege.dao.model.PriUserFollowPO;
import com.meetingshow.privilege.service.model.PriUserFollowQueryParas;
import com.meetingshow.privilege.service.util.PriUserFollowQueryParasBuilder;
import com.meetingshow.privilege.service.util.PriUserFollowServiceParas;

public class PriUserFollowServiceImp extends BaseServiceImp implements
        IPriUserFollowService {

    private PriUserFollowDAO priUserFollowDAO;

    /**
     * @return the priUserFollowDAO
     */
    public PriUserFollowDAO getPriUserFollowDAO() {
        return priUserFollowDAO;
    }

    /**
     * @param priUserFollowDAO
     *            the priUserFollowDAO to set
     */
    public void setPriUserFollowDAO(PriUserFollowDAO priUserFollowDAO) {
        this.priUserFollowDAO = priUserFollowDAO;
    }

    @Override
    public Integer savePriUserFollow(PriUserFollowPO priUserFollowPO)
            throws Exception {
        return getPriUserFollowDAO().savePriUserFollow(priUserFollowPO);
    }

    @Override
    public void updatePriUserFollow(PriUserFollowPO priUserFollowPO) throws Exception {
        getPriUserFollowDAO().updatePriUserFollow(priUserFollowPO);
    }

    @Override
    public void removePriUserFollow(PriUserFollowPO priUserFollowPO) throws Exception {
        getPriUserFollowDAO().removePriUserFollow(priUserFollowPO);
    }

    @Override
    public QueryResults<PriUserFollowPO> queryPriUserFollow(
            PriUserFollowQueryParas priUserFollowQueryParas) throws Exception {
        QueryStruct queryStruct = new QueryStruct();
        List<String> tableList = new ArrayList<String>();
        List<String> returnObjectList = new ArrayList<String>();

        tableList.add(PriUserFollowServiceParas.PRI_USER_FOLLOW_PO);
        returnObjectList.add(PriUserFollowServiceParas.PRI_USER_FOLLOW_PO);

        queryStruct.setTableList(tableList);
        queryStruct.setReturnObjectList(returnObjectList);

        queryStruct = PriUserFollowQueryParasBuilder.priUserFollowQueryBuilder(
                queryStruct, priUserFollowQueryParas);
        QueryResults<PriUserFollowPO> queryResults = getPriUserFollowDAO()
                .queryPriUserFollow(queryStruct);
        return queryResults;
    }

}
